package com.itheima.mapper;

import com.itheima.pojo.Student;
import com.itheima.pojo.StudentQueryParam;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface StudentMapper {



    //查询
    List<Student> selectStudent(StudentQueryParam studentQueryParam);
    //删除
    void deleteStudent(@Param("ids") List<Integer> ids);
    //新增
    void postStudent(Student student);

    //id查询
    Student getStudentById(Integer id);
    //修改
    @Options(useGeneratedKeys = true, keyProperty = "id")
    void putStudent(Student student);

    //学院学历统计
    @MapKey("name")
    List<Map> getStudentDegreeData();

    //班级人数查询
    @MapKey("clazz")
    List<Map> getStudentclazzData();
}
